Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress format-security warning #33

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

ruddyscent
Copy link
Contributor

The project rubric requests not to generate any warnings during the build process, so the starter code should not raise any warnings. However, it does raise the following warnings:

src/ncurses_display.cpp:33:12: warning: format not a string literal and no format arguments [-Wformat-security]
   33 |   mvwprintw(window, ++row, 2, ("OS: " + system.OperatingSystem()).c_str());
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This PR uses the methods in this thread to suppress the above warnings.

The warning message is
```
src/ncurses_display.cpp:33:12: warning: format not a string literal and no format arguments [-Wformat-security]
   33 |   mvwprintw(window, ++row, 2, ("OS: " + system.OperatingSystem()).c_str());
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
The solution is listed at [this thread](spdk/spdk#2237).
@ruddyscent ruddyscent requested a review from a team as a code owner September 10, 2023 14:03
@ruddyscent ruddyscent requested review from SudKul and removed request for a team September 10, 2023 14:03
Fix format of code
@SudKul SudKul merged commit 284b715 into udacity:master Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants